package controlador;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;




import vista.FrmPrincipal;

public class ContPrincipal {
	private FrmPrincipal frm = null;
	
	
	public ContPrincipal() {
	}
	
	
	public void mostrar(JFrame frame) {
		frm = new FrmPrincipal(frame, this);
		frm.setLocationRelativeTo(null);
		frm.setVisible(true);
		
		
		
		frm.getItmCategoria().addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				ContActualizarCategoria contcats = new ContActualizarCategoria();
				
				contcats.mostrar(frm);
			
			}
		});
		
		frm.getItmIngrediente().addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				ContActualizarIngredientes contings = new ContActualizarIngredientes();
				
				contings.mostrar(frm);
				
			}
		});
		
		frm.getItmProducto().addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				ContActualizarProductos contprods = new ContActualizarProductos();
				
				contprods.mostrar(frm);
				
			}
		});
		
		frm.getItmVenta().addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				ContOrden contord = new ContOrden();
				
				contord.mostrar(frm);
				
			}
		});
		
		frm.getItmCompra().addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				ContCompra contcomp = new ContCompra();
				
				contcomp.mostrar(frm);
				
			}
		});
		
		frm.getItmProductos().addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				ContListadoVentas contlvent = new ContListadoVentas();
				
				contlvent.mostrar(frm);
				
			}
		});
		
		frm.getItmIngredientes().addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				
				ContListadoIngredientes contling = new ContListadoIngredientes();
				
				contling.mostrar(frm);
				
				
			}
		});
	}
}
